macro(add_rewrite_library target src_file)
    add_library(${target} ${src_file})
    add_dependencies(${target} MLIRtoy)
    target_link_libraries(${target} 
        PUBLIC
        MLIRtoy
        MLIRAnalysis
        MLIRIR
        MLIRParser
        MLIRPass
        MLIRSideEffectInterfaces
        MLIRTransforms
        )
endmacro(add_rewrite_library target src_file)

# add_rewrite_library(rewrite "./rewrite.cpp")

add_rewrite_library(lower_to_arith "LowerToArith.cpp")

add_rewrite_library(lower_to_llvm "LowerToLLVM.cpp")